package config;

// read-only Singleton, no need to consider thread safety
public class Config {
    private final int port;
    private final String webRoot;
    private final int maxThread;

    private static class SingletonHolder {
        private static final Config instance = new Config();
    }

    private Config() {
        port = 1234;
        webRoot = "webroot";
        maxThread = 3;
    }

    public static Config getConfig() {
        return SingletonHolder.instance;
    }

    public int getPort() {
        return this.port;
    }

    public String getWebRoot() {
        return this.webRoot;
    }

    public int getMaxThread() {
        return this.maxThread;
    }
}
